-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(anta): Mcs client mounts #898
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #898 will not alter performanceComparing Summary
|
Quality Gate passedIssues Measures |
""" | ||
|
||
name = "VerifyMcsClientMounts" | ||
description = "Verify if all service MCS Client management cvx mounts are mountStateMountComplete" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we try to keep the description shorter here as they show up in the reports and it can clutter them
* Success: The test will pass if the MCS mount status on MCS Clients are mountStateMountComplete. | ||
* Failure: The test will fail if the MCS mount status on MCS Clients are not mountStateMountComplete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs rewording as there are several failure tests and I am not sure what to expect if all clients are mounted or if only one is?
mcs_mount_state_detected = True | ||
state = mount_state["state"] | ||
if state != "mountStateMountComplete": | ||
self.result.is_failure(f"MCS Client mount states are not valid: {state}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this enough information in the error message? would you want to the the type that's failing as well?
if mount_state["type"].startswith("Mcs"): | ||
mcs_mount_state_detected = True | ||
state = mount_state["state"] | ||
if state != "mountStateMountComplete": | ||
self.result.is_failure(f"MCS Client mount states are not valid: {state}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if mount_state["type"].startswith("Mcs"): | |
mcs_mount_state_detected = True | |
state = mount_state["state"] | |
if state != "mountStateMountComplete": | |
self.result.is_failure(f"MCS Client mount states are not valid: {state}") | |
if not mount_state["type"].startswith("Mcs"): | |
continue | |
mcs_mount_state_detected = True | |
if (state := mount_state["state"]) != "mountStateMountComplete": | |
self.result.is_failure(f"MCS Client mount states are not valid: {state}") |
if state != "mountStateMountComplete": | ||
self.result.is_failure(f"MCS Client mount states are not valid: {state}") | ||
|
||
if len(mount_states) == 0 or not mcs_mount_state_detected: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is redundant as if len(mount_states) == 0
then necessarily mcs_mount_state_detected
will be False
if len(mount_states) == 0 or not mcs_mount_state_detected: | |
if not mcs_mount_state_detected: |
Examples | ||
-------- | ||
```yaml | ||
anta.tests.configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it really a configuration test?
Would you not prefer a new MCS category maybe?
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Description
Anta Tests to verify if management cvx mounts for service mcs is in healthy state = mountStateMountComplete
Checklist:
pre-commit run
)tox -e testenv
)